<script setup lang="ts">
import { useCrud } from "@/mixins/simple";
import { Delete } from "@element-plus/icons-vue";
import service from "./api";
import optionFunc from "./option";

const { context, bindVal, option, events, crud } = useCrud(service, optionFunc);
</script>

<template>
  <CrudContainer>
    <avue-crud
      ref="crud"
      v-model="context.form"
      v-model:page="context.page"
      v-model:search="context.searchForm"
      v-bind="bindVal"
      :option="option"
      v-on="events"
    >
      <template #menu-left="{ size }">
        <el-button
          type="danger"
          :icon="Delete"
          :size="size"
          @click="events.rowsDel"
          >删除
        </el-button>
      </template>
    </avue-crud>
  </CrudContainer>
</template>

<style scoped lang="scss"></style>
